<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>{{$bags[0]->books->book_name}} - 转让详情</title>
    <meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="format-detection" content="telephone=no">
    <meta name="author" content="夜读书">
    <meta name="description" content="图书(出售，借阅，交换，赠送)-夜读书">
    <meta name="keywords" content="夜读书，同城换书，图书，图书借阅，图书交换，图书赠送，图书出售，图书漂流">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/mobile.css') }}">    
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
</head>
<body>
@include('mobile.nav')
<div id="shopinfo">

    @if($bags[0]->condition == 10)
        <?php $condition = '全新'; ?>
    @endif
    @if($bags[0]->condition == 9)
        <?php $condition = '9成新'; ?>
    @endif
    @if($bags[0]->condition == 8)
        <?php $condition = '8成新'; ?>
    @endif
    @if($bags[0]->condition == 7)
        <?php $condition = '7成新'; ?>
    @endif
    @if($bags[0]->condition == 6)
        <?php $condition = '6成新'; ?>
    @endif
    @if($bags[0]->condition == 5)
        <?php $condition = '5成新'; ?>
    @endif
    @if($bags[0]->condition == 0)
        <?php $condition = '较旧'; ?>
    @endif 

    @if($bags[0]->scope == 'L')
        <?php $scope = "同城"; ?>
    @endif
    @if($bags[0]->scope == 'R')
        <?php $scope = "不限"; ?>
    @endif
            
    {{-- J借阅，E交换，S出售，Z赠送，B以上均可 --}}
    @if($bags[0]->otype == 'J')
        <?php $otype = '借阅'; ?>
    @elseif($bags[0]->otype == 'E')
        <?php $otype = '交换'; ?>
    @elseif($bags[0]->otype == 'S')
        <?php $otype = '￥' . $bags[0]->nowprice; ?>
    @elseif($bags[0]->otype == 'Z')
        <?php $otype = '赠送'; ?>
    @else
        <?php $otype = '￥' . $bags[0]->nowprice; ?>
    @endif

    @if($bags[0]->users->sex == 1)
        <?php $sex = "images/ico/male.png"; ?>
    @endif
    @if($bags[0]->users->sex == 2)
        <?php $sex = "images/ico/female.png"; ?>
    @endif
    @if($bags[0]->users->sex == 3)
        <?php $sex = "images/ico/sex_unknow.png"; ?>
    @endif

    @if($bags[0]->users->avatar_file != null)
        <?php $touxiang = "http://www.yedushu.com/" . $bags[0]->users->avatar_file_min; ?>
    @else
        <?php $touxiang = "http://www.yedushu.com/usersface/default/avatar-min.png"; ?>
    @endif

    <div class="bookimg">
        <a href="{{url('mobile/info/'.$bags[0]->books->book_id)}}"><img src="http://www.yedushu.com/{{$bags[0]->books->bimg}}"></img></a>
    </div>
    <div class="bookinfo">
        <a href="{{url('mobile/info/'.$bags[0]->books->book_id)}}">
        <div class="bookname">{{$bags[0]->books->book_name}}</div>
        <div class="isbn"><span>isbn:{{$bags[0]->books->isbn}}</span></div>
        <div class="zuozhe"><span>{{$bags[0]->books->zuozhe}} | {{$bags[0]->books->chubanshe}}</span></div>
        <div class="jiage"><span class="nowprice">{{$otype}}</span> <span class="price">￥{{$bags[0]->books->dingjia}}</span></div>
        </a>
        <div class="oth">
            <span><img src="{{url('images/ico/date.png')}}"></img><span class="txtalign">{{date('Y-m-d', $bags[0]->add_time)}}</span></span>
            <span><img src="{{url('images/ico/quality.png')}}"></img><span class="txtalign">{{$condition}}</span></span></span>
            <span><img src="{{url('images/ico/book_count.png')}}"></img><span class="txtalign">{{$bags[0]->num}}本</span></span>
            <span><img src="{{url('images/ico/personal_my_address.png')}}"></img><span class="txtalign">{{$scope}}</span></span>
        </div>
        @if($bags[0]->beizhu != '')
        <div class="beizhu">备注：{!! $bags[0]->beizhu !!}</div>
        @endif
    </div>
    <div class="userinfo">
        <a href="{{url('mobile/uhome/'. $bags[0]->users->uid)}}"><img class="bimg" style="float:left;" src="{{$touxiang}}"></img></a>
        <dl style="margin-left: 55px;">        
            <dt class="city"><span>{{$bags[0]->users->province}}{{$bags[0]->users->city}}</span></dt>
            <dt class="sex"><img src="{{url($sex)}}"></img>
            <a href="{{url('mobile/uhome/'. $bags[0]->users->uid)}}">
                <span class="username">{{$bags[0]->users->user_name}}</span>
            </a>
            </dt>
            <dt class="shopjieshao">
            @if($usersattribs != null)
                @if($usersattribs->shopjieshao !='')
                    {{$usersattribs->shopjieshao}}
                @else
                    这个人很懒，没留下书城介绍。
                @endif
            @else
                这个人很懒，没留下书城介绍。
            @endif
            </dt>
        </dl>
        <div style="clear:both"></div>
    </div>
    <div class="liuyan">
        <div class="txtitle">留言</div>
        @if(count($liuyans)==0)
        <div class="item">暂无留言</div>
        @else
        @foreach($liuyans as $liuyan)
            @if($liuyan->users->avatar_file != null)
                <?php $liuyan_touxiang = "http://www.yedushu.com/" . $liuyan->users->avatar_file_min; ?>
            @else
                <?php $liuyan_touxiang = "http://www.yedushu.com/usersface/default/avatar-min.png"; ?>
            @endif

            @if($liuyan->users->sex == 1)
                <?php $liuyan_sex = "images/ico/male.png"; ?>
            @endif
            @if($liuyan->users->sex == 2)
                <?php $liuyan_sex = "images/ico/female.png"; ?>
            @endif
            @if($liuyan->users->sex == 3)
                <?php $liuyan_sex = "images/ico/sex_unknow.png"; ?>
            @endif

        <div class="item">
            <a href="{{url('mobile/uhome/'. $liuyan->users->uid)}}">
            <img class="bimg" style="float:left;" src="{{$liuyan_touxiang}}"></img> 
            </a> 
            <dl style="margin-left:37px;">
                <dt><img style="width:1em;height:1em" src="{{url($liuyan_sex)}}">
                <span class="username"><a href="{{url('mobile/uhome/'. $liuyan->users->uid)}}">{{$liuyan->users->user_name}}</a></span>
                <dt class="lytext">{{$liuyan->lytext}}</dt>
                <dt><span style="float:right;padding-right:5px;font-size:10px">{{date('Y-m-d H:i:s', $liuyan->add_time)}}</span></dt></dt>
            </dl>
            <div style="clear:both"></div>
        </div>
        @endforeach
        @endif
    </div>

</div> 

@include('mobile.footer')
</body>
</html>